Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Feat/access control #88

Merged
merged 9 commits into from
Sep 15, 2023
Merged

Feat/access control #88

merged 9 commits into from
Sep 15, 2023

Conversation

Jaguarmouse
Copy link
Contributor

@Jaguarmouse Jaguarmouse commented Sep 15, 2023

#81

  • fixes roles
  • adds access control when registering SLD and TLD
  • checks roles when updating SLD records

@Jaguarmouse Jaguarmouse requested a review from taryune September 15, 2023 09:08
if domain.Owner != msg.Creator {
return nil, sdkerrors.Wrapf(errors.New(fmt.Sprintf("%s.%s", msg.Name, msg.Parent)), types.ErrDomainNotOwned.Error())
if isEditable, roleErr := domain.IsRecordEditable(msg.Creator); !isEditable {
return nil, roleErr
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

roleErr -> err

if domain.Owner != msg.Creator {
return nil, sdkerrors.Wrapf(errors.New(fmt.Sprintf("%s.%s", msg.Name, msg.Parent)), types.ErrDomainNotOwned.Error())
if isEditable, roleErr := domain.IsRecordEditable(msg.Creator); !isEditable {
return nil, roleErr
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

roleErr -> err

@taryune
Copy link
Member

taryune commented Sep 15, 2023

@Jaguarmouse

  • Fix CLI compilation error
Error: x/registry/client/cli/query_second_level_domain_test.go:37:42: undefined: types.SubdomainRole
Error: x/registry/client/cli/query_top_level_domain_test.go:32:42: undefined: types.TopLevelDomainRole
  • Add owner on TLD created

@Jaguarmouse Jaguarmouse requested a review from taryune September 15, 2023 09:51
@Jaguarmouse Jaguarmouse merged commit ed87238 into main Sep 15, 2023
@taryune taryune deleted the feat/access-control branch October 17, 2023 10:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants